--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 581ec4f0fd98d60f0f6243d6caaa23e8783c5275
Parents : c1acf96
Author : Mark Qvist <mark@unsigned.io>
Date : 2022-12-22T11:47:05+01:00
Fixed double announce at startup
Changes
Diff
diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py
index aeb3fec7..6cf81c5c 100644
--- a/sbapp/sideband/core.py
+++ b/sbapp/sideband/core.py
@@ -1272,6 +1272,9 @@ class SidebandCore():
now = time.time()
announce_wanted = self.getstate("wants.announce")
+ # TODO: The "start_announce" config entry should be
+ # renamed to "auto_announce", which is its current
+ # meaning.
if self.config["start_announce"] == True:
needs_if_change_announce = False
for interface in RNS.Transport.interfaces:
@@ -1411,14 +1414,15 @@ class SidebandCore():
self.setpersistent("lxmf.syncretrying", False)
def __start_jobs_deferred(self):
- if self.config["start_announce"]:
- self.lxmf_announce()
-
if self.is_service:
self.service_thread = threading.Thread(target=self._service_jobs, daemon=True)
self.service_thread.start()
- if self.is_standalone or self.is_service:
+ if self.is_standalone or self.is_service:
+ if self.config["start_announce"]:
+ self.lxmf_announce()
+ self.last_if_change_announce = time.time()
+
self.periodic_thread = threading.Thread(target=self._periodic_jobs, daemon=True)
self.periodic_thread.start()
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────